package com.tianshuo.factorybean.main;

import com.tianshuo.factorybean.NonBasePackageConfig;
import com.tianshuo.factorybean.bean.Father;
import com.tianshuo.factorybean.config.FactoryBeanConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author tianshuo
 */
public class AnnotationApplication {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(FactoryBeanConfig.class);
        applicationContext.refresh();

        System.out.println(applicationContext.getBean("&myFactoryBean"));
        System.out.println(applicationContext.getBean("myFactoryBean"));
        System.out.println(applicationContext.getBean(Father.class));

    }
}
